﻿namespace Raven
{
    public class FuzzySetSingleton : FuzzySet
    {
        private Fix _midPoint;
        private Fix _leftOffset;
        private Fix _rightOffset;

        public FuzzySetSingleton(Fix mid, Fix left, Fix right) : base(mid)
        {
            _midPoint = mid;
            _leftOffset = left;
            _rightOffset = right;
        }

        public override Fix CalculateDOM(Fix val)
        {
            if (val >= _midPoint - _leftOffset && val <= _midPoint - _rightOffset)
            {
                return 1;
            }

            return 0; 
        }
    }
}